package Exam.String;

import java.util.StringJoiner;

public class StringJoiner2 {
    public static void main(String[] args) {
        //间隔，头，尾
        StringJoiner sj = new StringJoiner(",","[","]");

        sj.add("aaa").add("bbb").add("ccc");
        System.out.println(sj);
        //[aaa,bbb,ccc]

        int len = sj.length();
        System.out.println(len);

        String str = sj.toString();
        System.out.println(str);
    }
}
